package leetcode.onehundred;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

//448. 找到所有数组中消失的数字
public class FindDisappearedNumbers {
    public static void main(String[] args) {
        System.out.println(new FindDisappearedNumbers().findDisappearedNumbers(new int[]{1, 1}));
    }

    public List<Integer> findDisappearedNumbers(int[] nums) {
        int length = nums.length;
        List<Integer> res = new ArrayList<>();
        HashSet<Integer> set = new HashSet<>();
        for (int num : nums) {
            set.add(num);
        }
        for (int i = 1; i <= length; i++) {
            if (!set.contains(i)) {
                res.add(i);
            }
        }
        return res;
    }
}
